<?php
//if($test){debug($test);}
//echo $this->Form->create();
$joblists=$formData['joblists'];
$dmdforms=$formData['dmdforms'];
?>
    <fieldset>
        <legend><?php __('Add New Back Up'); ?></legend>
<?php
             echo $this->Form->input('backup_name',array('label'=>__('Name',true)));
             echo $this->Form->input('backup_surname',array('label'=>__('Surname',true)));
             echo $this->Form->input('backup_id_code',array('label'=>__('Id Code',true)));
             echo $this->Form->input('backup_id_erp',array('label'=>__('Id Erp',true)));
             
?>           <h2 class="showNextDiv pointer">Job Function</h2>
                <div class="isHidden">
<?php
                echo $this->Form->input('backup_jobfunction_id',array('options'=>$joblists['jobfunctions'],'empty'=>'select','label'=>__('Jobfunction',true))); ?>
                <div class="showNextBtn isNewBUJobfunction">Not in this List ?</div>
                <div class="isNewBUJobfunctionDiv isHidden">
<?php 
                    echo $this->Form->input('is_new_backup_jobfunction',array('label'=>false,'class'=>'isHidden'));
                    echo $this->Form->input('backup_jobfunction_title',array('label'=>__('Jobfunction Title',true)));   ?>
                </div>
            </div>
<?php
?>
            <h2 class="showNextDiv  pointer">Job Profile</h2>
            <div class="isHidden">
                <?php
                echo $this->Form->input('backup_jobprofile_ids',array('options'=>$joblists['jobprofiles'],'multiple'=>true,'label'=>__('JobProfiles',true)));
                ?>
            </div>

            <h2 class="showNextDiv pointer">Demand form for new Back Up</h2>
            <div class="isHidden">
                <?php
                echo $this->Form->input('backup_created',array('type'=>'checkbox','label'=>__('Demand form for this new user created ?',true)));
                ?>
                <div class="backupHasDmdForm isHidden">
                    <?php
                    echo $this->Form->input('backup_dmdform',array('options'=>$dmdforms,'empty'=>'select','label'=>__('Demand form for this user',true)));
                    ?>
                </div>
            </div>
          
<?php
?>
    </fieldset>
<?php
//echo $this->Form->end('submit');
?>
<script type="text/javascript">
    $(document).ready(function(){
        if($('#DmdformBackupJobfunctionTitle').val().length>0){
            $('.isNewBUJobfunctionDiv').show();
        }
    });
</script>